using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class RoolButton : MonoBehaviour
{
    [SerializeField] Text nameText;

    private Button button;

    private void Awake()
    {
        button = GetComponent<Button>();
    }

    public void SetName(string name)
    {
        nameText.text = name;
    }
    public void AddActionToButton(Action action)
    {
        button.onClick.AddListener(() =>
        {
            action?.Invoke();
        });
    }
}
